package com.lijing.service;

import com.lijing.dao.NewsDao;
import com.lijing.model.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "NewsService")
public class NewsServiceImpl implements NewsService {

    @Autowired
    private NewsDao newsDao;

    @Override
    public void addNews(News news) {
        newsDao.addNews(news);
    }

    @Override
    public News getNews(Integer nid) {
        return newsDao.getNews(nid);
    }

    @Override
    public List<News> getNewsListByClub(Integer cid) {
        return newsDao.getNewsListByClub(cid);
    }

    @Override
    public void deleteNews(Integer nid) {
        newsDao.deleteNews(nid);
    }

    @Override
    public List<News> getNewsList() {
        return newsDao.getNewsList();
    }
}
